﻿// ***********************************************************************
// Assembly         : DonNicky.Common
// Author           : donnicky
// Created          : 11-19-2012
//
// Last Modified By : donnicky
// Last Modified On : 11-24-2012
// ***********************************************************************
using System;
using System.Collections.Generic;

namespace DonNicky.Common
{
    /// <summary>
    /// IEnumerable generic class extensions.
    /// </summary>
    public static class EnumerableExtensions
    {
        /// <summary>
        /// Applies a function to every element of the enumerable.
        /// </summary>
        public static void ForEach<T>(this IEnumerable<T> enumerable, Action<T> function)
        {
            foreach (var item in enumerable)
                function(item);
        }
    }
}
